import {Timeline,Icon} from 'antd';
import { inject, observer } from 'mobx-react';
import './style/index.css';

@inject('changeListStore')
@observer
class ChangeList extends React.Component {
    constructor(props) {
		super(props);
    
    }

    componentDidMount(){
        const {changeListStore} = this.props;
        const refId = this.props.refId;
        changeListStore.init(refId);
    }
    
    componentWillUnmount(){
		const {componentWillUnmount} = this.props.changeListStore;
		componentWillUnmount();
	}

	render() {
       
        const {changeListStore} = this.props;
        const {list} = changeListStore;

		return (
            <div className="wea-contract-synergy-changlist">
                {list.length>0?<div className="content">
                    <Timeline >
                        {list.map(c=>{
                            return <Timeline.Item>
                                <div className="title"><a href={"javaScript:openSPA4Single('/main/workflow/req?requestid="+c.requestid+"','"+c.requestid+"')"}>{c.requestname}</a><span>({c.nodename})</span></div>
                                <div className="info">发起人：{c.creater}</div>
                                <div className="time">{c.createdate}</div>
                            </Timeline.Item>
                        })}
                    </Timeline>
                </div>
                :<div style={{textAlign:'center',color:'#ccc'}}>暂无数据</div>}
               
            </div>
        );
    };


    
}

export default ChangeList;